﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Activities;
using Northeast.BRE.Engine.Activities;
using Northeast.BRE.Common;
using Northeast.BRE.Engine;

namespace Northeast.BRE.Testbed
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            WorkflowInvoker wi = new WorkflowInvoker(new WorkflowContainer());

            WorkflowContainer wc = new WorkflowContainer();
            Dictionary<string,object> @params = new Dictionary<string,object>();
            @params.Add("Parallel",true);
            @params.Add("Subjects",new ISupportsValidation[] { new MyObject() } );

            //wc.Parallel = true;
            //wc.Subjects = new InArgument<ISupportsValidation[]>(new ISupportsValidation[] { new MyObject()});

            try
            {
                wi.Invoke(@params);
            }
            catch (RuleExecutionException reException)
            {
                MessageBox.Show(reException.Message + Environment.NewLine + reException.InternalException.Message);
            }
        }
    }
}
